package com.example.management.system.service.impl

import com.example.management.common.domain.UserCompanyDO
import com.example.management.system.dao.UserCompanyDao
import com.example.management.system.service.UserCompanyService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

@Service
class UserCompanyServiceImpl : UserCompanyService {

    @Autowired
    private val userCompanyDao: UserCompanyDao? = null

    override operator fun get(companyId: Long?): UserCompanyDO {
        return userCompanyDao!!.get(companyId)
    }

    override fun list(map: Map<String, Any>): List<UserCompanyDO> {
        return userCompanyDao!!.list(map)
    }

    override fun count(map: Map<String, Any>): Int {
        return userCompanyDao!!.count(map)
    }

    override fun save(userCompany: UserCompanyDO): Int {
        return userCompanyDao!!.save(userCompany)
    }

    override fun update(userCompany: UserCompanyDO): Int {
        return userCompanyDao!!.update(userCompany)
    }

    override fun remove(companyId: Long?): Int {
        return userCompanyDao!!.remove(companyId)
    }

    override fun batchRemove(companyIds: Array<Long>): Int {
        return userCompanyDao!!.batchRemove(companyIds)
    }

}